<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
	"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>TitlePane Test</title>

	<style type="text/css">
		@import "../../dojo/resources/dojo.css";
		@import "css/dijitTests.css";
	</style>

	<!-- required: a default dijit theme: -->
	<link id="themeStyles" rel="stylesheet" href="../../dijit/themes/tundra/tundra.css">

	<!-- required: dojo.js -->
	<script type="text/javascript" src="../../dojo/dojo.js"
		djConfig="parseOnLoad: true, isDebug: true"></script>

	<!-- not needed, for testing alternate themes -->
	<script type="text/javascript" src="_testCommon.js"></script>

	<script language="JavaScript" type="text/javascript">
		dojo.require("dijit.dijit"); // optimize: load dijit layer
		dojo.require("dijit.TitlePane");
		dojo.require("dojo.parser");	// scan page for widgets and instantiate them

		// widgets used inside subpage loaded via href=
		dojo.require("dijit.form.Button");
		dojo.require("dijit.form.ComboBox");
		dojo.require("dijit.layout.TabContainer");
		dojo.require("dijit.layout.LinkPane");

		function randomMessageId(){
			return Math.floor(Math.random() * 3) + 3;
		}

		dojo.declare("dijit.TestTitlePane", dijit.TitlePane, {
			templateString: '<div class="dijitTitlePane">' +
							'    <div class="dijitTitlePaneTitle" dojoAttachPoint="titleBarNode" style="cursor: default;">' +
							'        <span dojoAttachEvent="onclick:toggle,onkeypress: _onTitleKey,onfocus:_handleFocus,onblur:_handleFocus" tabindex="0"' +
							'                waiRole="button" dojoAttachPoint="focusNode,arrowNode" style="cursor: pointer;">' +
							'			<img src="${_blankGif}" alt="" class="dijitArrowNode" waiRole="presentation">' +
							'			<span dojoAttachPoint="arrowNodeInner" class="dijitArrowNodeInner"></span>' +
							'		 </span>' +
							'        <span dojoAttachPoint="titleNode" class="dijitTitlePaneTextNode"></span>' +
							'    </div>' +
							'    <div class="dijitTitlePaneContentOuter" dojoAttachPoint="hideNode">' +
							'        <div class="dijitReset" dojoAttachPoint="wipeNode">' +
							'            <div class="dijitTitlePaneContentInner" dojoAttachPoint="containerNode" waiRole="region" tabindex="-1">' +
							'            </div>' +
							'        </div>' +
							'    </div>' +
							'</div>'
		});
	</script>
</head>
<body class="tundra">
	<h1 class="testTitle">Dijit TitlePane Test</h1>

	<input id="input" value="for tab testing">

	<h1>Test #1: plain title pane, width=300px</h1>
	<div dojoType="dijit.TitlePane" title="Title Pane #1"
		tooltip="I'm the tooltip for Title Pane #1's title bar"
		style="width: 300px;" jsId="pane1" id="testPane1">
		Lorem Ipsum Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque
		iaculis, nulla id semper faucibus, pede tellus nonummy magna, vitae adipiscing
		orci arcu ut augue. Nunc condimentum, magna a vestibulum convallis, libero purus
		pulvinar orci, sed vestibulum urna sem ut pede. More Ipsum...
		Sed sollicitudin suscipit risus. Nam ullamcorper. Sed nisl lectus, pellentesque
		nec, malesuada eget, ornare a, libero. Lorem ipsum dolor sit amet,
		consectetuer adipiscing elit.
	</div>
	<button id="titleButton" onclick="pane1.attr('title', 'New Title')">change title</button>
	<button id="closeButton" onclick="pane1.attr('open', false)">close pane</button>
	<h1>Test #2: title pane with form, width=300px</h1>

	<div dojoType="dijit.TitlePane" title="Title Pane #2" id="pane_2" style="width: 300px;">
		<form>
			<label for="age">Age: </label> <input id="age"><br>
			<label for="disc">Discount card </label><input id="disc" type=checkbox><br>
			<button>Submit</button><br>
		</form>
	</div>
	<br>

	<h1>Test #3: initially closed pane</h1>
	<div id="closed" dojoType="dijit.TitlePane" title="Initially closed pane" open="false" width="200">
		<form>
			<label for="age">Age: </label><input id="age"><br>
			<label for="discount">Discount card </label><input type="checkbox" id="discount"><br>
			<button>Submit</button><br>
		</form>

		<p>And a TabContainer, to make sure it lays out correctly:</p>
		<div id="tabContainer" dojoType="dijit.layout.TabContainer" style="width: 400px; height: 250px;">
			<a dojoType="dijit.layout.LinkPane" href="layout/tab1.html" onLoad="console.log('load of SubTab 1');">SubTab 1</a>
			<a dojoType="dijit.layout.LinkPane" href="layout/tab2.html"  onLoad="console.log('load of SubTab 2');" selected="true">SubTab 2</a>
		</div>
	</div>
	<button onclick="dijit.byId('closed').attr('content', 'hello world! (' + new Date() + ')');">reset content</button>

	<h1>Test #4: title pane with href (initially closed)</h1>
	<p>The pane should open to "Loading..." message and then 3 seconds later it should slide open more to show loaded data.</p>
	<div dojoType="dijit.TitlePane" duration="1000" title="Pane from href" id="href1" open="false"
		href="layout/getResponse.php?delay=3000&messId=3" preventCache="true"
		style="width: 400px;">
		Loading...
	</div>

	<h1>Test #5: title pane with href (initially closed)</h1>
	<p>The pane should start to open to "Loading..." but halfway through href data will be loaded, and it should expand correctly.</p>
	<div dojoType="dijit.TitlePane" duration="1000" title="Pane from href" id="href2" open="false"
		href="layout/getResponse.php?delay=500&messId=3" preventCache="true"
		style="width: 400px;">
		Loading...
	</div>

	<h1>Test #6: nested title pane</h1>
	<div id="outer" dojoType="dijit.TitlePane" title="Outer pane" width="300">
		<p>This is a title pane, containing another title pane ...
		<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque iaculis, nulla id semper faucibus, pede tellus nonummy magna, vitae adipiscing orci arcu ut augue. Nunc condimentum, magna a vestibulum convallis, libero purus pulvinar orci, sed vestibulum urna sem ut pede.
More Ipsum...

		<div id="inner" dojoType="dijit.TitlePane" title="Inner pane" width="250">
			<p>And this is the inner title pane...
			<p>Sed sollicitudin suscipit risus. Nam ullamcorper. Sed nisl lectus, pellentesque nec, malesuada eget, ornare a, libero. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
		</div>

		<p>And this is the closing line for the outer title pane.
	</div>

	<h1>Test #7: subclassed title pane (only arrow is selectable and focusable)</h1>
	<div dojoType="dijit.TestTitlePane" title="Title Pane #7" style="width: 300px;" id="ttp">
		Lorem Ipsum Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque
		iaculis, nulla id semper faucibus, pede tellus nonummy magna, vitae adipiscing
		orci arcu ut augue. Nunc condimentum, magna a vestibulum convallis, libero purus
		pulvinar orci, sed vestibulum urna sem ut pede. More Ipsum...
		Sed sollicitudin suscipit risus. Nam ullamcorper. Sed nisl lectus, pellentesque
		nec, malesuada eget, ornare a, libero. Lorem ipsum dolor sit amet,
		consectetuer adipiscing elit.
	</div>

	<table style="border: solid blue 2px; margin-top: 1em;">
		<tr>
			<td>
				Here's some text below the title panes (to make sure that closing a title pane releases the space that the content was taking up)
			</td>
		</tr>
	</table>
	<h1>Test #8: locked open title pane</h1>
	<div dojoType="dijit.TitlePane" title="Title Pane #8" style="width: 300px;" toggleable="false" id="locked">
		Lorem Ipsum Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque
		iaculis, nulla id semper faucibus, pede tellus nonummy magna, vitae adipiscing
		orci arcu ut augue. Nunc condimentum, magna a vestibulum convallis, libero purus
		pulvinar orci, sed vestibulum urna sem ut pede. More Ipsum...
		Sed sollicitudin suscipit risus. Nam ullamcorper. Sed nisl lectus, pellentesque
		nec, malesuada eget, ornare a, libero. Lorem ipsum dolor sit amet,
		consectetuer adipiscing elit.
	</div>
</body>
</html>
